找传奇、传世资源到传世资源站!

C# 数字键盘控件

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈


from clipboard
using System;using System.Collections.Generic;using System.ComponentModel;using System.Drawing;using System.Data;using System.Linq;using System.Text;using System.Windows.Forms;namespace KeyboardControl{ public partial class ControlKeyboard : UserControl { public ControlKeyboard() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { SetNumber("1"); } private void button2_Click(object sender, EventArgs e) { SetNumber("2"); } private void button3_Click(object sender, EventArgs e) { SetNumber("3"); } private void button4_Click(object sender, EventArgs e) { SetNumber("4"); } private void button5_Click(object sender, EventArgs e) { SetNumber("5"); } private void button6_Click(object sender, EventArgs e) { SetNumber("6"); } private void button7_Click(object sender, EventArgs e) { SetNumber("7"); } private void button8_Click(object sender, EventArgs e) { SetNumber("8"); } private void button9_Click(object sender, EventArgs e) { SetNumber("9"); } private void button10_Click(object sender, EventArgs e) { string text = textBox1.Text; if (text == "" || text == "请输入") { } else { text = text.Substring(0, text.Length - 1); if (text == "") { textBox1.Text = "请输入"; } else { textBox1.Text = text; } } } private void button11_Click(object sender, EventArgs e) { SetNumber("0"); } private void button12_Click(object sender, EventArgs e) { MessageBox.Show("输入的数字为" textBox1.Text); } private void SetNumber(string number) { string text = textBox1.Text; if (text == "请输入") { textBox1.Text = number; } else { textBox1.Text = text = number; } } }}

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复